/*
 * @Author: error: git config user.name && git config user.email & please set dead value or install git
 * @Date: 2022-08-23 22:57:54
 * @LastEditors: error: git config user.name && git config user.email & please set dead value or install git
 * @LastEditTime: 2022-08-23 23:03:51
 * @FilePath: \crm_customer\src\store\operationLogStore.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import {makeAutoObservable} from 'mobx'
import services  from '../service'

class operationLogStore{
    constructor(){
        makeAutoObservable(this)
      }
      current_page=1
      page_size=5
      total=''
      operationLogList=[]; //操作日志列表数据
      timeInfo={
        start_time:'',
        end_time:''
      }  //时间选择器信息

       //获取列表数据方法
       getoperationLogList=(current_page,page_size)=>{
        return new Promise((resolve,reject)=>{
       services.operationLogService.getAllDataList(current_page,page_size).then((data)=>{
         resolve(data)
         console.log(data.data,"getoperationLogList");
         this.operationLogList=data.data
        
       })
        })
   } 

     //快速搜索按钮方法
     getSeachList=()=>{
        return new Promise((resolve,reject)=>{
          services.operationLogService.searvhBtn().then((data)=>{
            resolve(data.data)
            this.operationLogList=data.data
          })
           })
      }

        //删除按钮方法
        deleteBtnfun=(action_id)=>{
            return new Promise((resolve,reject)=>{
              services.operationLogService.deleteBtn(action_id).then((data)=>{
                resolve(data)
                console.log(data);
              })
            })
          }
            //删除所有方法
      deleteAllData=()=>{
        return new Promise((resolve,reject)=>{
          services.operationLogService.deleteAllData().then((data)=>{
            resolve(data)
            console.log(data.data);
            this.operationLogList=data.data
          })
        })
      }
}
export default operationLogStore